package quadrato;

public class Cube extends Square {

    private double lato;

    @Override
    public boolean setLato(double pLato) {
        if (pLato > 0) {
            this.lato = pLato;
            return true;
        }
        return false;
    }

    @Override
    public double getLato() {
        return this.lato;
    }

    @Override
    public double perimetro() {
        double perimetro = this.lato * 12;
        return perimetro;
    }

    @Override
    public double area() {
        double area = this.lato * this.lato * this.lato;
        return area;
    }

    @Override
    public String toString() {
        return this.lato + " x " + this.lato + " x " + this.lato;
    }
}
